<%--
  Created by IntelliJ IDEA.
  User: ZTK
  Date: 2025/6/15
  Time: 23:25
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<head>
  <title>支付成功 - 二手平台</title>
  <link href="${pageContext.request.contextPath}/resources/css/bootstrap.min.css" rel="stylesheet">
  <link rel="stylesheet" href="${pageContext.request.contextPath}/resources/css/bootstrap-icons.css">
  <style>
    body {
      background-color: #f8f9fa;
      padding-top: 70px;
    }
    .success-container {
      max-width: 600px;
      margin: 0 auto;
      text-align: center;
      padding: 40px;
      background: white;
      border-radius: 10px;
      box-shadow: 0 0 20px rgba(0,0,0,0.1);
      margin-top: 50px;
    }
    .success-icon {
      font-size: 80px;
      color: #28a745;
      margin-bottom: 20px;
    }
    .success-title {
      font-size: 28px;
      font-weight: 700;
      margin-bottom: 20px;
      color: #333;
    }
    .success-info {
      background-color: #f9f9f9;
      border-radius: 8px;
      padding: 20px;
      margin: 30px 0;
      text-align: left;
    }
    .info-item {
      display: flex;
      margin-bottom: 12px;
    }
    .info-label {
      width: 100px;
      font-weight: 600;
      color: #6c757d;
    }
    .btn-group {
      margin-top: 30px;
    }
    .btn-continue {
      background-color: #007bff;
      color: white;
      padding: 10px 20px;
      border-radius: 5px;
      font-weight: 600;
      margin-right: 15px;
    }
    .btn-order {
      background-color: #6c757d;
      color: white;
      padding: 10px 20px;
      border-radius: 5px;
      font-weight: 600;
    }

    .navbar{
      background-color: #ff5000;
    }
    .navbar-brand{
      font-size: 20px;
      color: white !important;
      font-weight: bold;
    }
  </style>
</head>
<body>
<!-- 导航栏 -->
<nav class="navbar navbar-expand-lg fixed-top">
  <div class="container">
    <a class="navbar-brand" href="${pageContext.request.contextPath}/product/list">二手平台</a>
    <div class="d-flex flex-grow-1 justify-content-center">
      <div class="text-white fw-bold">支付成功</div>
    </div>
    <ul class="navbar-nav">
      <c:choose>
        <c:when test="${not empty sessionScope.currentUser}">
          <li class="nav-item dropdown">
            <a class="nav-link dropdown-toggle" href="#" id="userDropdown" role="button" data-bs-toggle="dropdown">
                ${sessionScope.currentUser.username}
            </a>
            <ul class="dropdown-menu dropdown-menu-end">
              <li><a class="dropdown-item" href="${pageContext.request.contextPath}/order/list">我的订单</a></li>
              <li><hr class="dropdown-divider"></li>
              <li><a class="dropdown-item" href="${pageContext.request.contextPath}/user/logout">退出登录</a></li>
            </ul>
          </li>
        </c:when>
        <c:otherwise>
          <li class="nav-item">
            <a class="nav-link" href="${pageContext.request.contextPath}/user/login">登录</a>
          </li>
        </c:otherwise>
      </c:choose>
    </ul>
  </div>
</nav>

<div class="container">
  <div class="success-container">
    <div class="success-icon">
      <i class="bi bi-check-circle"></i>
    </div>
    <div class="success-title">支付成功！</div>
    <p>感谢您的购买，商品将在3-5个工作日内送达</p>

    <div class="success-info">
      <div class="info-item">
        <div class="info-label">订单号:</div>
        <div>${order.id}</div>
      </div>
      <div class="info-item">
        <div class="info-label">支付金额:</div>
        <div>¥<fmt:formatNumber value="${order.totalAmount}" pattern="#,##0.00" /></div>
      </div>
      <div class="info-item">
        <div class="info-label">支付时间:</div>
        <div><fmt:formatDate value="${order.paidTime}" pattern="yyyy-MM-dd HH:mm:ss" /></div>
      </div>
      <div class="info-item">
        <div class="info-label">收货人:</div>
        <div>${order.receiverName}</div>
      </div>
      <div class="info-item">
        <div class="info-label">收货地址:</div>
        <div>${order.receiverAddress}</div>
      </div>
    </div>

    <div class="btn-group">
      <a href="${pageContext.request.contextPath}/product/list" class="btn btn-continue">
        继续购物
      </a>
      <a href="${pageContext.request.contextPath}/order/detail/${order.id}" class="btn btn-order">
        查看订单
      </a>
    </div>
  </div>
</div>

<script src="${pageContext.request.contextPath}/resources/js/jquery-3.6.0.min.js"></script>
<script src="${pageContext.request.contextPath}/resources/js/popper.min.js"></script>
<script src="${pageContext.request.contextPath}/resources/js/bootstrap.min.js"></script>
</body>
</html>
